<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<kd-info-card>
  <kd-info-card-header>
    <kd-resource-card-list-title>
      [[Details|Header in a detail view]]
    </kd-resource-card-list-title>
  </kd-info-card-header>
  <kd-info-card-section>
    <kd-object-meta-info-card object-meta="::$ctrl.node.objectMeta">
    </kd-object-meta-info-card>
    <kd-info-card-entry title="[[Addresses|Label 'Addresses' for the node addresses displayed on its details page.]]"
                        ng-if="::$ctrl.node.addresses">
      <div ng-repeat="(index, address) in $ctrl.node.addresses"
           class="kd-chips">
        <kd-middle-ellipsis display-string="{{::address.type}}: {{::address.address}}"
                            class="kd-chip">
        </kd-middle-ellipsis>
      </div>
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Taints|Label 'Taints' for the node taints displayed on its details page.]]"
                        ng-if="::$ctrl.node.taints">
      <div ng-repeat="(index, taint) in ::$ctrl.node.taints"
           class="kd-chips">
        <kd-middle-ellipsis display-string="{{::taint.key}}={{::taint.value}}:{{::taint.effect}}"
                            class="kd-chip"
                            ng-if="::taint.value">
        </kd-middle-ellipsis>
        <kd-middle-ellipsis display-string="{{::taint.key}}:{{::taint.effect}}"
                            class="kd-chip"
                            ng-if="::!taint.value">
        </kd-middle-ellipsis>
      </div>
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Phase|Label 'Phase' for the node namespace on the node details page.]]"
                        ng-if="::$ctrl.node.phase">
      {{$ctrl.node.phase}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Pod CIDR|Label 'Pod CIDR' for the node external ID displayed on its details page.]]"
                        ng-if="::$ctrl.node.podCIDR">
      {{$ctrl.node.podCIDR}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Provider ID|Label 'Provider ID' for the node external ID displayed on its details page.]]"
                        ng-if="::$ctrl.node.providerID">
      {{$ctrl.node.providerID}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Unschedulable|Label 'Unschedulable' for the node external ID displayed on its details page.]]">
      {{$ctrl.node.unschedulable}}
    </kd-info-card-entry>
  </kd-info-card-section>
  <kd-info-card-section name="[[System info|Subtitle 'System info' for the right section with general information about node system on the node details page.]]">
    <kd-info-card-entry title="[[Machine ID|Label 'Machine ID' for the node machine ID displayed on its details page.]]"
                        ng-if="::$ctrl.node.nodeInfo.machineID">
      {{$ctrl.node.nodeInfo.machineID}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[System UUID|Label 'System UUID' for the node system UUID displayed on its details page.]]"
                        ng-if="::$ctrl.node.nodeInfo.systemUUID">
      {{$ctrl.node.nodeInfo.systemUUID}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Boot ID|Label 'Boot ID' for the node boot ID displayed on its details page.]]"
                        ng-if="::$ctrl.node.nodeInfo.bootID">
      {{$ctrl.node.nodeInfo.bootID}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Kernel Version|Label 'Kernel Version' for the node kernel version displayed on its details page.]]"
                        ng-if="::$ctrl.node.nodeInfo.kernelVersion">
      {{$ctrl.node.nodeInfo.kernelVersion}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[OS Image|Label 'OS Image' for the node OS image displayed on its details page.]]"
                        ng-if="::$ctrl.node.nodeInfo.osImage">
      {{$ctrl.node.nodeInfo.osImage}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Container Runtime Version|Label 'Container Runtime Version' for the node container runtime version displayed on its details page.]]"
                        ng-if="::$ctrl.node.nodeInfo.containerRuntimeVersion">
      {{$ctrl.node.nodeInfo.containerRuntimeVersion}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Kubelet Version|Label 'Kubelet Version' for the node Kubelet version displayed on its details page.]]"
                        ng-if="::$ctrl.node.nodeInfo.kubeletVersion">
      {{$ctrl.node.nodeInfo.kubeletVersion}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Kube-Proxy Version|Label 'Kube-Proxy Version' for the node Kube-Proxy version displayed on its details page.]]"
                        ng-if="::$ctrl.node.nodeInfo.kubeProxyVersion">
      {{$ctrl.node.nodeInfo.kubeProxyVersion}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Operating system|Label 'Operating system' for the node operating system displayed on its details page.]]"
                        ng-if="::$ctrl.node.nodeInfo.operatingSystem">
      {{$ctrl.node.nodeInfo.operatingSystem}}
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Architecture|Label 'Architecture' for the node architecture displayed on its details page.]]"
                        ng-if="::$ctrl.node.nodeInfo.architecture">
      {{$ctrl.node.nodeInfo.architecture}}
    </kd-info-card-entry>
  </kd-info-card-section>
</kd-info-card>

<kd-node-allocated-resources allocated-resources="::$ctrl.node.allocatedResources"></kd-node-allocated-resources>

<kd-content-card ng-if="::$ctrl.node.conditions.length">
  <kd-content>
    <kd-condition-list conditions="::$ctrl.node.conditions"></kd-condition-list>
  </kd-content>
</kd-content-card>
